package me.mycentral.AndroidShoppingListMTT;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class RecipeDBHelper extends SQLiteOpenHelper {
	
	private static final String DATABASE_NAME = "ASLMrecipes";
	private static final int DATABASE_VERSION = 1;
	private final Context mHelperContext;
	private SQLiteDatabase mDatabase;
	private static final String RECIPE_TABLE_CREATE = "CREATE TABLE recipes(name TEXT, yield TEXT)";
	private static final String INGREDIENT_TABLE_CREATE = "CREATE TABLE ingredients(recipe_id INTEGER, name TEXT, value REAL, type TEXT)";

	public RecipeDBHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
		mHelperContext = context;
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		mDatabase = db;
		mDatabase.execSQL(RECIPE_TABLE_CREATE);
		mDatabase.execSQL(INGREDIENT_TABLE_CREATE);

	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		mDatabase = db;

	}

}
